#include"process.h"

#define total  2048.0
#define once  0.1;
const int base = 10;

void download()
{
    double current = 0.0;
    while(current < total)
    {
        //模拟下载行为
        int r = rand() % base + 1;
        double speed = r * base;
        current += speed;
        if(current >= total) current = total;
        usleep(100000);

        //进度条匹配
        //processbar
        Process(total,current);

        //printf("test: %.1lf/%.1lf\r",current,total);
        //fflush(stdout); 
    }
    printf("\n"); 
}

int main()
{
    srand(time(NULL));
    download();
    return 0;
}

